package com.lizheng.yunservice.travel.controller;

import com.lizheng.yunservice.common.domain.ApiRestResponse;
import com.lizheng.yunservice.common.domain.PageQuery;
import com.lizheng.yunservice.common.page.TableDataInfo;
import com.lizheng.yunservice.travel.doamin.bo.VtpVoteWorkBo;
import com.lizheng.yunservice.travel.doamin.vo.VtpVoteWorkVo;
import com.lizheng.yunservice.travel.service.IVtpNoticeService;
import com.lizheng.yunservice.travel.service.IVtpVoteWorkService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 投票活动
 *
 * @author lizheng
 * @date 2024-06-06
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/vtp/app/voteActivity")
public class VtpAppVoteActivityController {

    private final IVtpNoticeService noticeService;
    private final IVtpVoteWorkService iVtpVoteWorkService;

    @GetMapping("/getHomeNotice")
    public ApiRestResponse<List<String>> getHomeNotice() {
        List<String> list = noticeService.getHomeNotices();
        return ApiRestResponse.ok(list);
    }

    /**
     * 作品分页列表
     */
    @GetMapping("/getWorkList")
    public TableDataInfo<VtpVoteWorkVo> getWorkList(VtpVoteWorkBo bo, PageQuery pageQuery) {
        return iVtpVoteWorkService.queryAppPageList(bo, pageQuery);
    }
}
